import { ref } from 'vue'
import type { BondFundData } from '../types'
import { useChartData } from './useChartData'

export function useBondFundData() {
  const { generateRatioData } = useChartData()

  const mockConfig = {
    startDate: '2008-07-02',
    endDate: '2023-06-30',
    dataPoints: 200
  }

  const bondFundData = ref<BondFundData>({
    m2ToMarketRatio: {
      name: 'M2与A股总市价比率',
      data: generateRatioData(mockConfig),
      color: '#3B82F6'
    },
    cfetsIndices: [
      {
        name: 'CFETS亮伯用茅级短期险资券总指数总收益',
        data: generateRatioData(mockConfig),
        color: '#3B82F6'
      },
      {
        name: 'CFETS5-10年期中成活跃性改策性金验债指致总收益',
        data: generateRatioData(mockConfig),
        color: '#F59E0B'
      },
      {
        name: 'CFETS1-3年期中赢活跃性致策性金验惯指欧总收益',
        data: generateRatioData(mockConfig),
        color: '#10B981'
      },
      {
        name: 'CFETS同业存单AAA指数总收益',
        data: generateRatioData(mockConfig),
        color: '#8B5CF6'
      }
    ]
  })

  return {
    bondFundData
  }
}
